package com.jacky.iot.utils;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class MathUtils {

    public static double doubleScale(double num,int scale) {
        BigDecimal bd = new BigDecimal(num);
        bd = bd.setScale(scale, RoundingMode.HALF_UP);
        return bd.doubleValue();
    }
}
